<?php
Yii::import('zii.widgets.CPortlet');
class TagCloud extends CPortlet
{
	public $maxTags;
	
	public $title = "tags";
	
	public function renderContent()
	{
		$tags = Tag::model()->findTagWieghts($this->maxTags);

		$lis = '';
		foreach ($tags as $tag) {
			$lis .= CHtml::tag('li', array(),
			CHtml::link("{$tag->name} [{$tag->frequency}]", array('post/index', 'tag' => $tag->name))
			) . "\n";
		}
		echo CHtml::tag('ul', array(), $lis);
	}
}